﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using FluentNHibernate.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using YasharEl.Infrastructure.Core.PersistenceModel.NHibernate.Applications.Mappings;
using YasharEl.Infrastructure.ProcessEngine.EntityModel;
using YasharEl.Infrastructure.ProcessEngine.PersistenceModel.NHibernate.Mappings;

namespace YasharEl.Infrastructure.ProcessEngine.PersistenceModel.NHibernate.Tests
{
    [TestClass]
    public class ProcessDefinitionGroupMappingTest : InMemoryDatabaseTest
    {
        public ProcessDefinitionGroupMappingTest()
            : base
            (
                new Assembly[] 
                { 
                    typeof(ProcessDefinitionGroupEntityMap).Assembly, 
                    typeof(ApplicationEntityMap).Assembly 
                }
            )
        {
        }

        [TestMethod]
        public void CanCorrectlyMapProcessDefinitionGroup()
        {
            new PersistenceSpecification<ProcessDefinitionGroupEntity>(session)
                .CheckProperty(c => c.ProcessDefinitionGroupId, (long)1)
                .CheckProperty(c => c.GroupName, "Infrastructure Tests Processes")
                .CheckProperty(c => c.GroupDescription, "Infrastructure Tests Processes")
                .VerifyTheMappings();
        }
    }
}
